﻿using System;
using ClientOverflow.DataTransferObjects;

namespace ClientOverflow.Core
{
    /// <summary>
    /// The login service is an internal class which maintains the logic status of the application. In addition
    /// it's in charge of registering new logged in user and notify all the service observers that a new user
    /// has logged in.
    /// </summary>
    class LoginService : ILoginService
    {
        public void Login(User user)
        {
            LoggenInUser = user;
            OnLoginChanged(this, EventArgs.Empty);
        }

        public User LoggenInUser { get; private set; }
        public event EventHandler OnLoginChanged = (sender, args) => { };
    }
}